home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / bcc_src.lha / Parser / test / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-25  |  1.1 KB  |  63 lines

  1. #include <proto/exec.h>
  2. #include <proto/muimaster.h>
  3. #include <proto/intuition.h>
  4.  
  5. #include <libraries/mui.h>
  6.  
  7. #include "initcl.h"
  8. #include "MyApplication.h"
  9.  
  10. #ifndef MAKE_ID
  11. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  12. #endif
  13.  
  14. struct Library *MUIMasterBase;
  15.  
  16. /*extern ULONG __stack = 10000;
  17. extern ULONG __OSlibversion = 36;*/
  18.  
  19. short SetApp( void );
  20.  
  21.  
  22. Object *app, *win;
  23.  
  24. main()
  25. {
  26.     ULONG running = TRUE, ret = RETURN_OK;
  27.     ULONG sigs = 0;
  28.     
  29.     if( MUIMasterBase = OpenLibrary( MUIMASTER_NAME, MUIMASTER_VMIN) ) {
  30.         if( _initclasses() && SetApp() ) {
  31.  
  32.            while( DoMethod( app, MUIM_Application_NewInput, &sigs )
  33.                   != MUIV_Application_ReturnID_Quit ) {
  34.               if( sigs ) {
  35.                  sigs = Wait( sigs | SIGBREAKF_CTRL_C );
  36.                  if( sigs & SIGBREAKF_CTRL_C ) break;
  37.               }
  38.            }
  39.  
  40.         } else ret = RETURN_ERROR;
  41.         MUI_DisposeObject( app );
  42.         _freeclasses();
  43.  
  44.         CloseLibrary( MUIMasterBase );
  45.     } else ret = RETURN_ERROR;
  46.     
  47.     return ret;
  48. }
  49.  
  50.  
  51. short SetApp( void )
  52. {
  53.  
  54.     app = MyApplicationObject,
  55.     End;
  56.  
  57.     if( !app ) return 0;
  58.  
  59.     
  60.     return 1;
  61.  
  62. }
  63.